<template>
  <div class="page-container">
    <el-card shadow="none">
      <div class="table-box">
        <el-table
          v-loading="loading"
          :data="tableData"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(255, 255, 255, 0.8)"
          row-key="id"
          :tree-props="{children: 'children'}"
          @selection-change="onSelect"
        >
          <el-table-column type="index" width="60px" />
          <el-table-column
            v-for="item in columns"
            :key="item.prop"
            :prop="item.prop"
            :label="item.label"
            align="center"
          />
        </el-table>
      </div>
    </el-card>
  </div>
</template>

<script>
import crud from '@/mixins/crud'
import { http_dept } from '@/api'

export default {
  mixins: [crud],
  data() {
    return {
      request: {
        list: http_dept.tree
      },
      searchParams: {
      },
      tableData: [
      ],
      columns: [
        { prop: 'id', label: '委办局ID', width: '', minWidth: '' },
        { prop: 'deptName', label: '委办局名称', width: '', minWidth: '' },
        { prop: 'parentDeptName', label: '父部门名称', width: '', minWidth: '' }
      ]
    }
  }
}
</script>

<style lang="scss">
.page-container {
  height: 100%;
}
</style>
